﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommerceOne.Domains.Entities;

namespace CommerceOne.Domains.UnBoundEnities
{
    public class CartProduct
    {
        public CartProduct()
        {
        }

        public CartProduct(Product product, int quantity)
        {
            this.Id = product.Id;
            this.Name = product.Name;
            this.Price = product.EnablePrice2 ? product.Price2.Value : product.Price1.Value;
            this.Quantity = quantity;
            this.SubTotal = this.Price*this.Quantity;
            this.Bonus = product.Bonus;
            this.Code = product.Code;
        }

        public long Id { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public string Bonus { get; set; }
        public decimal Price { get; set; }
        public int Quantity { get; set; }
        public decimal SubTotal { get; set; }
    }
}
